﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'proc_cm_GetPhoto')
BEGIN
    PRINT 'Dropping Procedure proc_cm_GetPhoto'
    DROP  Procedure  proc_cm_GetPhoto
END
GO

PRINT 'Creating Procedure proc_cm_GetPhoto'
GO

CREATE Procedure dbo.proc_cm_GetPhoto
	@pPhotoId uniqueidentifier
AS
BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;

	select
		[photo_id]
		,[photoalbum_id]
		,[filename_txt]
		,[filepath_txt]
		,[filesize_num]
		,[title_txt]
		,[desc_txt]
		,[create_dttm]
		,[public_ind]
		,[featured_ind]
	from
		[dbo].[tbl_photo]
	where
		[photo_id] = @pPhotoId
END
GO

GRANT EXEC ON dbo.proc_cm_GetPhoto TO PUBLIC
GO

